#pragma once


#include<vector>
#include<iostream>

using namespace std;

static const int __stl_num_primes = 28;
static const unsigned long __stl_prime_list[__stl_num_primes] =
{
  53,         97,         193,       389,       769,
  1543,       3079,       6151,      12289,     24593,
  49157,      98317,      196613,    393241,    786433,
  1572869,    3145739,    6291469,   12582917,  25165843,
  50331653,   100663319,  201326611, 402653189, 805306457,
  1610612741, 3221225473, 4294967291
};

inline unsigned long __stl_next_prime(unsigned long n)
{
	const unsigned long* first = __stl_prime_list;
	const unsigned long* last = __stl_prime_list + __stl_num_primes;
	const unsigned long* pos = lower_bound(first, last, n);
	return pos == last ? *(last - 1) : *pos;
}

namespace yyh
{
	template<class K, class V>
	struct HashTableNode
	{
		pair<K, V> _kv;
		HashTableNode<K, V>* _next;

		HashTableNode(const pair<K, V> kv)
			:_kv(kv)
			,_next(nullptr)
		{ }
	};

	template<class K, class V>
	class HashTable
	{
		typedef HashTableNode<K, V> Node;
	public:
		HashTable(size_t size = __stl_next_prime(0))
			:_tables(size, nullptr)
		{ }

		bool Insert(const pair<K, V> kv)
		{
			size_t hash_i = kv.first % _tables.size();

		}

	private:
		vector<Node*> _tables;
		size_t _n = 0;
	};
}